package literary.fuwenhao.com.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class Main2Activity extends AppCompatActivity {
    Intent intent;
    Intent intent1;
    int type;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        Intent intent = getIntent();
       type= intent.getIntExtra("type",0);
    }

    public void btn1(View view) {
        if (type==1){
            intent1=new Intent(this,MainActivity.class);
            startActivity(intent1);
        }
        else if(type==3) {
            intent1=new Intent(this,Main3Activity.class);
            startActivity(intent1);
        }
    }

}
